<template>
  <van-nav-bar
    title="看板"
    left-text="返回"
    left-arrow
    fixed
    @click="handleBack"
  />
</template>

<script lang="ts" setup>
import dayjs from 'dayjs'
import { ref, defineEmits, defineProps } from 'vue'
import { useVModel } from '@vueuse/core'
import { useDatePicker } from '/@/use/datePicker'
import { useBack } from '/@/use/useRouteBack'

const props = defineProps({
  modelValue: {
    type: String,
    default: '',
  },
  reserveDate: {
    type: String,
    default: '',
  },
})

const emit = defineEmits(['update:modelValue'])

const value = useVModel(props, 'modelValue', emit)

const { back: handleBack } = useBack()

// const showReserveDatePicker = ref(false)

// function onConfirm(date: Date) {
//   showReserveDatePicker.value = false
//   value.value = dayjs(date).format('YYYY-MM-DD')
// }

const { onConfirm, picker: showReserveDatePicker } = useDatePicker(value)
</script>
